import {cuitaoApi} from '../services/products';
import { message } from 'antd';
export default {
    namespace:'products',
    state:null,
    effects: {
      *add({ payload }, { call, put }) {
        // console.log(payload,'payload')
        const response = yield call(cuitaoApi, payload);
         console.log(response,'responseresponse')
        if(response.code==1){
          message.success('成功')
        }
        yield put({
          type: 'saveadd',
          payload: response.data.active1[0]['NoteDesc'],
        });
      },
    
    },
    reducers:{
      'saveadd'(state,payload){   
        // console.log(payload.payload)  //此值就是dispatch传递过来的值
        return payload.payload //将此值赋值给state
      },
    
    }
  }